<?php
// application/controllers/TblcontactController.php

class TblcontactController extends Zend_Controller_Action
{
    public function indexAction()
    {
        $tblcontact = new Application_Model_TblcontactMapper();
        $this->view->entries = $tblcontact->fetchAll();
    }

    public function signAction()
    {
        $request = $this->getRequest();
        $form    = new Application_Form_Tblcontact();

        if ($this->getRequest()->isPost()) {
            if ($form->isValid($request->getPost())) {
                $allValue = new Application_Model_Tblcontact($form->getValues());
                $mapper  = new Application_Model_TblcontactMapper();
                $mapper->save($allValue);
                   return $this->_helper->redirector('index');
            }
        }

        $this->view->form = $form;
    }
}
